abstract class ElectronicProductFactory {
  Product createComputer();
  Product createMobile();
  Product createPad();
}

class Product {
  String? name;
  factory Product.createProductOne(String name) {
    return productOne;
  }
  Product._createProductOne();
  static Product productOne = Product._createProductOne();
}

///苹果
class Apple extends ElectronicProductFactory {
  @override
  Product createComputer() {
    return Product.createProductOne("Mac");
  }

  @override
  Product createMobile() {
    return Product.createProductOne("IPhone");
  }

  @override
  Product createPad() {
    return Product.createProductOne("IPad");
  }
}

///小米
class XiaoMi extends ElectronicProductFactory {
  @override
  Product createComputer() {
    return Product.createProductOne("RedMi");
  }

  @override
  Product createMobile() {
    return Product.createProductOne("MIUI");
  }

  @override
  Product createPad() {
    return Product.createProductOne("MIPad");
  }

}